package com.nineclock.doc.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nineclock.doc.pojo.DocFile;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DocumentFileMapper extends BaseMapper<DocFile> {
    /**
     * 查询该员工作为协作者的文件
     * @param companyUserId
     * @return
     */
    @Select("SELECT * FROM doc_file WHERE id IN (SELECT file_id FROM doc_collaborations WHERE collaboration_id=#{companyUserId})")
    public List<DocFile> queryUserCollaborationFile(Long companyUserId);
}
